import {useState} from "react";

interface Params {
  name: string;
  active: number;
}

export default function useModel() {
  const [object1, setObject1]: [{active?: number}, Function] = useState({});
  const [object2, setObject2] = useState({});

  const getObjects = (params: Params) => {
    // http request
    //
    setObject1({active: params.active});
    setObject2({});
  }

  return {
    state: {
      object1,
      object2
    },
    methods: {
      getObjects
    }
  }
}
